Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: inserted styles lost when moving elements #233

Open
wants to merge 2 commits into
base: sentry-v2
Choose a base branch
from

Conversation

billyvg
Copy link
Member

@billyvg billyvg commented Dec 17, 2024

fix code for nodejs tests
change fix direction to avoid issues with duplicate styles
format issues
swap waitForTimeout for waitForRAF in test that flaked
Add unit tests for new functions
Fix broken test causes by file formatting removing spaced


Co-authored-by: jaj1014 ajax@pendo.io
Co-authored-by: jaj1014 jaj1014@users.noreply.github.com

billyvg and others added 2 commits December 17, 2024 14:56
fix code for nodejs tests
change fix direction to avoid issues with duplicate styles
format issues
swap waitForTimeout for waitForRAF in test that flaked
Add unit tests for new functions
Fix broken test causes by file formatting removing spaced

---------

Co-authored-by: jaj1014 <ajax@pendo.io>
Co-authored-by: jaj1014 <jaj1014@users.noreply.github.com>
@billyvg billyvg changed the title fix: inserted styles lost when moving elements (#232) fix: inserted styles lost when moving elements Dec 17, 2024
@billyvg
Copy link
Member Author

billyvg commented Dec 17, 2024

Applying rrweb-io#1357 to our fork

@billyvg billyvg marked this pull request as ready for review December 17, 2024 20:31
@billyvg billyvg requested review from a team and chargome December 17, 2024 20:32
if (!elementCssRules || !elementCssRules.length) return;
// style sheet w/ innerText styles to diff with actual and get only inserted styles
const tempStyleSheet = new CSSStyleSheet();
tempStyleSheet.replaceSync(styleElement.innerText);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This could be an issue for some safari users: https://caniuse.com/mdn-api_cssstylesheet_replacesync but I'd leave it in.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants